import javax.media.opengl.*;

public class Star extends SceneGraphNode {
	public static float[][] colors = new float[][] {
		new float[] {1,1,0},
		new float[] {0,1,0},
		new float[] {0,1,1},
		new float[] {0,0,1},
		new float[] {1,0,1},
		new float[] {1,0,0}
	};
	
	private static Vector2f[] vertices = new Vector2f[] {
		new Vector2f(1,0),
		new Vector2f(.5f, PhysicsObject.SIN_60),
		new Vector2f(-.5f, PhysicsObject.SIN_60),
		new Vector2f(-1,0),
		new Vector2f(-.5f, -PhysicsObject.SIN_60),
		new Vector2f(.5f, -PhysicsObject.SIN_60)
	};
  public Star() {
    this(true);
  }
  
  public Star(boolean pickable) {
    super(pickable);
  }
  
  public void renderGeometry(GLAutoDrawable drawable) {
		GL2 gl = drawable.getGL().getGL2();
		gl.glBegin(GL.GL_TRIANGLES);
		for (int i = 0; i < vertices.length; i += 2) {
			gl.glColor3fv(colors[i], 0);
			gl.glVertex2f(vertices[i].x, vertices[i].y);
		}
		for (int i = 1; i < vertices.length; i += 2) {
			gl.glColor3fv(colors[i], 0);
			gl.glVertex2f(vertices[i].x, vertices[i].y);
		}
		gl.glEnd();
  }
}
